<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数学</title>
    <script>
        console.log(Math);
        console.log("-1绝对值 "+Math.abs(-1));
        console.log("1绝对值 "+Math.abs(1));
        console.log("1.9999向下取整 "+Math.floor(1.9999));
        console.log("1.0001向上取整 "+Math.ceil(1.0001));
        console.log("3.4四舍五入 "+Math.round(3.4));
        console.log("3.5四舍五入 "+Math.round(3.5));
        console.log("最大值 "+Math.max(1,2,3,4,56,76,78,54,23,54));
        console.log("最小值 "+Math.min(1,2,3,4,-56,76,78,54,23,54));
        console.log("随机数0~1 "+Math.random());
        console.log("随机数1~10 "+Math.ceil(Math.random()*10));
        console.log("随机数2~11 "+Math.floor(Math.random()*10)+2);
        console.log("根号2 "+Math.sqrt(2));
        console.log("2的10次幂 "+Math.pow(2,10));
        console.log("sin30° "+Math.sin(Math.PI/6).toFixed(1));
        //30deg没发直接写，Math算的事是弧度，pi=180deg,30deg=1/6*pi
        console.log("π "+Math.PI);
        // Math.PI数值有限不是真的π值
        
    </script>
</head>
<body>
    
</body>
</html>